//
//  UIView+SCBaseExt.h
//  SCFoundationKit
//
//  Created by Chao Sheng on 2023/10/17.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef enum {
    SCGradientPositionLeftToRight = 0,
    SCGradientPositionRightToLeft,
    SCGradientPositionTopToBottom,
    SCGradientPositionBottomToTop
} SCGradientPosition;

typedef enum {
    SCShowApiError = -3,
    SCShowTokenInvalid = -2,
    SCShowNoData = -1,
    SCShowNone = 0,
    SCShowLoading,
    SCShowNoDataOnlyImage,
    SCShowNoDataBySecure
} SCShowType;

#pragma mark - 占位图显示
@interface UIView (SCBasePlaceholder)

/// 展示占位图样式
- (void)sc_showPlaceholderType:(SCShowType)showtype;

/// 展示占位图样式，自定义图片,文字，传空字符串使用默认文本图片
- (void)sc_showPlaceholderType:(SCShowType)loadType
                      iconName:(NSString*)iconName
                         title:(NSString*)title;

@property (nonatomic, strong, readonly) UIView *sc_showBgView;

@property (nonatomic, strong, readonly) UIImageView *sc_showImageView;

@property (nonatomic, strong, readonly) UIButton *sc_showBtn;

@property (nonatomic, strong, readonly) UILabel *sc_showLabel;

@property (nonatomic, copy) void (^scReloadCallBack)(void);

@end

#pragma mark - 当前视图的vc
@interface UIView (SCBaseVC)
/// 所在的vc
@property (nonatomic, strong, readonly) UIViewController *sc_vc;

@end

#pragma mark - 视图效果
@interface UIView (SCViewEffect)
/// 毛玻璃效果
- (void)sc_BlurEffect;

/// 阴影效果
- (void)sc_Shadow;

/// 圆角效果
- (void)sc_roundingCorner:(UIRectCorner)corner
               inRectSize:(CGSize)rectSize
             cornerRadius:(CGFloat)radius;

/// 渐变
- (void)sc_gradientStyleColors:(NSArray*)colors
                      Position:(SCGradientPosition)position;
/// 渐变
- (void)sc_gradientStyleColors:(NSArray*)colors
                      Position:(SCGradientPosition)position
                          Size:(CGSize)size;

@end

#pragma mark - 坐标间距相关
@interface UIView (SCBaseExt)

@property (nonatomic, assign) CGFloat sc_x;

@property (nonatomic, assign) CGFloat sc_y;

@property (nonatomic, assign) CGFloat sc_width;

@property (nonatomic, assign) CGFloat sc_height;

@property (nonatomic, assign) CGFloat sc_left;

@property (nonatomic, assign) CGFloat sc_top;

@property (nonatomic, assign) CGFloat sc_right;

@property (nonatomic, assign) CGFloat sc_bottom;

@end

NS_ASSUME_NONNULL_END
